<%@ page language="java" contentType="text/html; charset=utf-8"
	pageEncoding="utf-8"%>
<%@page import="henu.javaweb.util.WebDbPool"%>
<%@page import="java.sql.*"%>
<%@page import="henu.javaweb.bean.Teacher"%>
<%@ page import="henu.javaweb.dao.TeacherDao" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>学生信息管理系统</title>
<link rel="stylesheet" href="../../css/bootstrap.min.css">
<link rel="stylesheet" href="../../css/my.css">
<script type="text/javascript" src="../../js/jquery-3.2.1.min.js"></script>
<script type="text/javascript" src="../../js/bootstrap.min.js"></script>
</head>
<body>
	<%
		Teacher t = new Teacher();
		String t_name = "Admin";
		TeacherDao dao = new TeacherDao();
		if (session.getAttribute("teacher") != null) {
			t = (Teacher) session.getAttribute("teacher");
			Teacher teacher = dao.findByTid(t.getT_id());

			if (teacher != null) {
				t_name = teacher.getT_username();
			} else {
				t_name = "Admin";
			}
		}
	%>
	<div id="top-pic"></div>
	<div class="navbar navbar-inverse navbar-static-top" role="navigation">
		<div class="container">
			<div class="navbar-header">
				<a class="navbar-brand"><strong>学生信息管理系统</strong></a>
			</div>
			<ul class="nav navbar-nav">
				<li class="test"><a href="main.jsp"><span
						class="glyphicon glyphicon-home"></span>首页</a></li>
				<li><a href="add.jsp"><span
						class="glyphicon glyphicon-user"></span>教师管理</a></li>
			</ul>
			<ul class="nav navbar-nav pull-right">
				<li><a class="navbar-brand"><small>欢迎您,<%=t_name%></small></a>
				</li>
				<%
					if(!t_name.equals("Admin")){
				%>
				<li><a href="#" data-toggle="modal" data-target="#changepass">
						<span class="glyphicon glyphicon-pencil"></span> 修改口令
				</a></li>
				<%
					}
				%>
				<li><a href="../MainLoginPage.jsp"> <span
						class="glyphicon glyphicon-off"></span> 退出
				</a></li>
			</ul>
		</div>
	</div>
	<!-- 修改口令使用的模态框 -->
	<div class="modal fade bs-example-modal-sm modal-dis" id="changepass"
		tabindex="-1" role="dialog" aria-labelledby="myModalLabel"
		aria-hidden="true">
		<div class="modal-dialog modal-sm">
			<div class="modal-content">
				<div class="modal-header">
					<button type="button" class="close" data-dismiss="modal"
						aria-hidden="true">&times;</button>
					<h4 class="modal-title" id="myModalLabel">
						<strong>修改口令</strong>
					</h4>
				</div>
				<div class="modal-body ">
					<form role="form" action="../../UpdateTeacherPasswordServlet" method="post" class="login-form">
						<div class="form-group">
							<input type="password" name="original_pass" style="width: 100%"
								placeholder="原口令" class="form-control" />
						</div>
						<div class="form-group">
							<input type="password" name="new_pass" style="width: 100%"
								placeholder="新口令" class="form-control" />
						</div>
						<div class="form-group">
							<input type="password" name="confirm_pass" style="width: 100%"
								placeholder="确认新口令" class="form-control" />
						</div>
						<div class="form-group">
							<input type="submit" class="btn btn-primary form-control"
								style="width: 100%" value="修改" />
						</div>
					</form>
				</div>
			</div>
		</div>
	</div>
	<div class="container">
		<h1>
			<img src="../../img/admin.jpg" class="img-circle" />学生信息管理
		</h1>
		<div class="warning">
			<h4>没有设置管理员帐号，默认管理员帐号存在安全风险，请尽快处理！</h4>
		</div>
	</div>
</body>
</html>